<script type="text/javascript">
$(document).ready(function()
{
  $('.checkAll').click(function () {
    if($(this).is(':checked'))
    {
      $('.checkboxAll').attr('checked','checked');
    }
    else
    {
    	$('.checkboxAll').removeAttr('checked');
    }
  });
});
function myFunction()
{
	if(confirm("You Want To Remove This Record")== true)
	{
		return true;
	}
	else
	{
		return false;
	}
}
</script>
{if $reminders==1}
  <form name="contentForm" id="contentForm" action="summaryChangeDate.php" method="POST">
{else}
  <form name="contentForm" id="contentForm" action="summaryPrintPdf.php" method="POST">
{/if}
<table border='0' align="center">
<tr>
	<th class="table1">
		{if $reminders==1}
		  &nbsp;
		{else}
      <input type="checkbox" name="checkAll" id="checkAll" class="checkAll">
	    <input type="submit" name="submitDateBtn" value="GO..." class="button" />
	  {/if}
	</th>
	<td align="center" class="table1">&nbsp;</td>
	<td align="center" class="table1">Party Name</td>
	<td align="center" class="table1">Phone No </td>
	<td align="center" class="table1">City</td>
	<td align="center" class="table1" align="right">JAMA Rupiya</td>
	<td align="center" class="table1" align="right">UDHAR Rupiya</td>
	{if $reminders==1}
	  <td align="center" class="table1" align="right" nowrap>Out Of Date
	    <input type="submit" value="Change" name="submit" onClick="changeDate();">
	    {html_select_date prefix="newRemindDate" start_year ="-8" end_year="+4" field_order="DMY" month_format="%m" day_value_format="%02d"}
	  </td>
	{/if}
	
</tr>

{section name=sec loop=$partyArray}
{if $partyArray[sec].total != 0}
<tr>
	<td class="table2" align="center">
		{if $reminders==1}
		  &nbsp;
		{else}
	    <input type="checkbox" class="checkboxAll" name="checkedParty[]" value="{$partyArray[sec].partyId}">
	  {/if}
	</td>
	<td class="table2" align="center">
	  <a href="summaryDelete.php?partyId={$partyArray[sec].partyId}" onclick="return myFunction();" class="link"><img src="./images/deleteIcon.png" height="20px" width="20px"></a>
	</td>
	<td>{$partyArray[sec].partyName}</td>
	<td>{$partyArray[sec].mobile1}</td>
	<td>{$partyArray[sec].city}</td>
	<td align="right">
		{if $partyArray[sec].total > 0}
		  {$partyArray[sec].total}
		{else}
		  0
		{/if}
	</td>
	<td align="right">
		{if $partyArray[sec].total < 0}
		  {$partyArray[sec].total}
		{else}
		  0
		{/if}		
	</td>
	{if $reminders==1}
	  <td align="center">
      <input type="checkbox" value="1" name="partyIdForDate['{$partyArray[sec].partyId}']"> {$partyArray[sec].remindDate|date_format:"%d-%m-%Y"}
	  </td>
	{/if}
</tr>
{/if}
{sectionelse}
<tr>
	<td colspan="8" align="center">
		<font color="red" size="5">No Records</font>
  </td>
</tr>
{/section}
<!---<tr>
<td colspan="6" align="right">{$totaljamaRupiya}</td>
<td colspan="1" align="right">{$totaludhaarRupiya}</td>
</tr>-->
<tr>
	{if $totalRupiya gt 0}
	<td colspan="8" align="center"><font color="green"><b>JAMA TOTAL :{$totalRupiya}</font></b></td>
	{elseif $totalRupiya lt 0}
	<td colspan="8" align="center"><font color="red"><b>UDHAR TOTAL :{$totalRupiya}</font></b></td>
	{else}
	<td colspan="8" align="center"><font color="blue"><b>TOTAL :{$totalRupiya}</font></b></td>
	{/if}
</tr>
</table>
</form>